Install ONLYOFFICE Docs Community on Debian Ubuntu

 

 

Document creation and management is one of the vital tasks in the professional sphere. Many times you will find yourself in a situation where you need to create, edit or view a document. Microsoft Office is the tool that comes to mind when you need to view or modify a document. On Linux, there are several alternatives to Microsoft Office. The popular ones are LibreOffice, WPS Office, SoftMaker Office, Calligra Office, Zoho Workplace, OnlyOffice etc.

Today, we will learn how to install ONLYOFFICE Docs Community on Debian / Ubuntu. But before that, let us discuss the features associated with this open-source tool.

ONLYOFFICE Dics is an offline comprehensive office suite that provides an array of tools required to process documents, collaborate and enhance productivity. It is fully compatible with the Office formats like the .docx, .xlsx, .pptx etc. It also offers all the popular functionality provided in office suites such:

You can also integrate it with ONLYOFFICE Groups to allow you share files, manage the access rights, view and edit files on a drive, oneDrive, Dropbox, OwnCloud etc.

ONLYOFFICE Docs comes in 4 different Editions:

In this guide we will learn how to install the ONLYOFFICE Docs Community on Debian / Ubuntu.

System Requirements

To install the ONLYOFFICE Docs Community Edition, you need a system that meets the below requirements:

1. Install the Dependency Packages

As mentioned above, there are several packages required by ONLYOFFICE Docs. Some of them are Nginx, PostgreSQL, RabbitMQ etc. So we will install each of them using the below steps:

First, update the system Paclage index and install cURL and vim:

sudo apt update -y && sudo apt install curl vim -y

Then proceed and install PosgreSQL on Debian/Ubuntu:

sudo apt install postgresql

Once the installation is complete, create a database and user for ONLYOFFICE Docs:

sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"

sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"

The next dependency is RabbitMQ which can be installed with the command:

sudo apt install rabbitmq-server

On Ubuntu 18.04, you will also need nginx-extras, installed with the command:

sudo apt-get install nginx-extras

Set a Custom Port for ONLYOFFICE Docs

The default port used by ONLYOFFICE Docs is 80. But form version 4.3, users are able to select a preferred port if the default one is in use.

To set a desired port, you can use the command with the below syntax:

echo onlyoffice-documentserver onlyoffice/ds-port select <PORT_NUMBER> | sudo debconf-set-selections

Here, you replace the PORT_NUMBER with the desired port.

2. Install ONLYOFFICE Docs Community

Once the required packages have been installed, you can install the ONLYOFFICE Docs Community Edition on your Debian / Ubuntu system.

Begin by adding the GPG keys to the system:

mkdir -p -m 700 ~/.gnupg

curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import

chmod 644 /tmp/onlyoffice.gpg

sudo chown root:root /tmp/onlyoffice.gpg

sudo mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg

Proceed and add the repository that provides the ONLYOFFICE Docs Community on Debian / Ubuntu:

echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list

Update the package index:

sudo apt update

Install the required fonts on your system:

sudo apt install ttf-mscorefonts-installer

On Debian, you might need to enable the Contrib and Non-Free Repositories. Modify the lines below on your system. For example Debian 12:

deb http://deb.debian.org/debian/ bookworm main contrib non-free

deb-src http://deb.debian.org/debian/ bookworm main contrib non-free

Once enabled, update the APT index and re-try installing the fonts above.

sudo apt update && sudo apt install ttf-mscorefonts-installer

Once complete, proceed and install ONLYOFFICE Docs Community on Debian / Ubuntu using:

sudo apt install onlyoffice-documentserver

Proceed with the installation as shown:

ONLYOFFICE Docs Community on DebianUbuntuONLYOFFICE Docs Community on DebianUbuntu

Provide the password for the PostgreSQL database created earlier.

Allow the port through the firewall if you have it enabled:

sudo ufw allow 80

3. Access and Use ONLYOFFICE Docs Community

Once complete, you can now access ONLYOFFICE Docs using the URL http://IP_Address or http://domain_name

ONLYOFFICE Docs Community on DebianUbuntu 1ONLYOFFICE Docs Community on DebianUbuntu 1

You will see the welcome page above:

ONLYOFFICE Docs Community on DebianUbuntu 2ONLYOFFICE Docs Community on DebianUbuntu 2

We can now test ONLYOFFICE Docs Community by running the commands provided then click on Go To Test Example:

If all is well, you will see this:

ONLYOFFICE Docs Community on DebianUbuntu 3ONLYOFFICE Docs Community on DebianUbuntu 3

You can create a documents to test if the ONLYOFFICE Docs Community is working:

ONLYOFFICE Docs Community on DebianUbuntu 4ONLYOFFICE Docs Community on DebianUbuntu 4

Now proceed and make the desired intergrations to ONLYOFFICE Docs. On our page, we have:

4. Secure ONLYOFFICE Docs with HTTPS

It is also possible to configure ONLYOFFICE Docs to use HTTPS. This involves generating certificates for your domain name. To achieve that, you can generate the signed certs using Let’sEncrypt.

Firs install the required tools:

sudo apt install certbot python3-certbot-nginx

Once installed, generate the certs for the domain name(ensure Nginx is running)

sudo bash /usr/bin/documentserver-letsencrypt.sh email@example.com yourdomain.com

Replace email@example.com with your valid email and yourdomain.com with your FQDN.

Saving debug log to /var/log/letsencrypt/letsencrypt.log

Plugins selected: Authenticator webroot, Installer None

Obtaining a new certificate

Performing the following challenges:

http-01 challenge for onlyoffice.computingforgeeks.com

Using the webroot path /var/www/onlyoffice/documentserver/letsencrypt for all unmatched domains.

Waiting for verification...

Cleaning up challenges

The script will generate certs and restart the Nginx service. You should now have ONLYOFFICE Docs accessible via HTTPS:

ONLYOFFICE Docs Community on DebianUbuntu 5ONLYOFFICE Docs Community on DebianUbuntu 5

5. Additional ONLYOFFICE Docs Installation Options

Apart form changing the ONLYOFFICE Docs default port, there are several other installation options that can be used for ONLYOFFICE Docs. These options are declared using debconf

They include:

You can use any other PostgreSQL database database server and specify it in the command:

echo onlyoffice-documentserver onlyoffice/db-host string <DB_HOST> | sudo debconf-set-selections

Here, DB_HOST should be replace with the actual address of the host.

You can also use a different user database replaced appropriately in the below commands:

echo onlyoffice-documentserver onlyoffice/db-user string <DB_USER> | sudo debconf-set-selections

echo onlyoffice-documentserver onlyoffice/db-pwd password <DB_PASSWORD> | debconf-set-selections

echo onlyoffice-documentserver onlyoffice/db-name string <DB_NAME> | sudo debconf-set-selections

To use a different RabbitMQ host, replace the host address of RABBITMQ_HOST in the below command:

echo onlyoffice-documentserver onlyoffice/rabbitmq-host string <RABBITMQ_HOST> | sudo debconf-set-selections

You can also use a custom user and password as shown:

echo onlyoffice-documentserver onlyoffice/rabbitmq-user string <RABBITMQ_USER> | sudo debconf-set-selections

echo onlyoffice-documentserver onlyoffice/rabbitmq-pwd password <RABBITMQ_PWD> | sudo debconf-set-selections

To set the enable JWT(JSON Web Tokens) use:

echo onlyoffice-documentserver onlyoffice/jwt-enabled boolean true | sudo debconf-set-selections

Now set the desired secret by replacing it under JWT_SECRET in the command:

echo onlyoffice-documentserver onlyoffice/jwt-secret password <JWT_SECRET> | sudo debconf-set-selections

You can read further on how to connect ONLYOFFICE Docs to ONLYOFFICE Groups, from the official ONLYOFFICE page.

Verdict

That is the end of this detailed guide on how to install ONLYOFFICE Docs Community on Debian / Ubuntu. I hope you too managed to get ONLYOFFICE Docs running.

See related content: